import requests from '@/utils/request'

// 数据库品种分组
export const DatalibGroupVariety = async () => {
  return  requests({
    url: '/v1/datlib/variety/',
    method: 'get',
  })
}

// 品种主数据指标
export const DataPrimaryIndex = (variety) => {
  return  requests({
    url: '/v1/datlib/variety/primaryIndex/',
    method: 'get',
    params: { variety }
  })
}

// 品种指标分组
export const DatalibVarietyIndexGroup = async (variety, parent) => {
  return  requests({
    url: '/v1/datlib/variety/indexGroup/',
    method: 'get',
    params: { variety, parent }
  })
}

// 品种指标分组树
export const DatalibVarietyIndexGroupTree = (variety) => {
  return  requests({
    url: '/v1/datlib/variety/indexGroupTree/',
    method: 'get',
    params: { variety }
  })
}

// 计算公式分组
export const CalculationGroup = (variety, parent) => {
  return  requests({
    url: '/v1/datlib/variety/formulaGroup/',
    method: 'get',
    params: { variety, parent }
  })
}

// 计算公式分树
export const CalculationGroupTree = (variety) => {
  return  requests({
    url: '/v1/datlib/variety/formulaGroupTree/',
    method: 'get',
    params: { variety }
  })
}